﻿using System;
using System.Collections.Generic;

namespace System.Linq
{
	public static class LinqExtensions
	{
		public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> action)
		{
			if (action == null) throw new ArgumentNullException("action");
			if (enumerable == null) return;

			foreach (var obj in enumerable)
				action(obj);
		}

		public static bool NotNullAny<T>(this IEnumerable<T> enumerable)
		{
			return enumerable != null && enumerable.Any();
		}
	}
}
